//
// Created by jiao on 2021/4/19.
//


#include "YHHandler.h"
#include "YHMainHandler.h"
#include "YHThreadHandler.h"

YHHandler *YHHandler_create(bool isMain, YqHandlerCallBackFunc *callBack) {
    if (isMain) {
        return new YHMainHandler(callBack);
    } else {
        return new YHThreadHandler(callBack);
    }
}

void YHHandler_destroy(YHHandler *handler) {
    if (handler) {
        handler->quit();
    }
}